package design.responsibility.demo01;

/**
 * <p>
 *  责任链模式测试
 * </P>
 *
 * @author dingwen
 * @date 2021.10.15 11:08
 */
public class ResponsibilityTest {
    public static void main(String[] args) {
        Concrete01Handler concrete01Handler = new Concrete01Handler();
        Concrete02Handler concrete02Handler = new Concrete02Handler();
        Concrete03Handler concrete03Handler = new Concrete03Handler();
        concrete01Handler.setNextHandler(concrete02Handler);
        concrete02Handler.setNextHandler(concrete03Handler);

        Response response = concrete01Handler.handler(new Request(new Level(3)));
        System.out.println("response = " + response);

    }
}
